import fetch from "./request.js";

// 校验字典数据唯一性（用于新增字典数据时校验，会返回字典数据已存在提示）
export function pageCreditLoan(data) {
  return fetch("/nb-pc/1.0.1/DictService/checkDictDataUnique", {
    method: "post",
    data: data,
  });
}
// 校验字典类型唯一性
export function checkDictTypeUnique(data) {
  return fetch("/nb-pc/1.0.1/DictService/checkDictTypeUnique", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 查询字典数据详情
export function queryDictDataDetail(data) {
  return fetch("/nb-pc/1.0.1/DictService/queryDictDataDetail", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    withLoading: true,
  });
}
// 查询字典类型详情
export function queryDictTypeDetail(data) {
  return fetch("/nb-pc/1.0.1/DictService/queryDictTypeDetail", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    withLoading: true,
  });
}
// 分页查询字典数据列表
export function queryDictDataPageInfo(data) {
  return fetch("/nb-pc/1.0.1/DictService/queryDictDataPageInfo", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 分页查询字典类型列表
export function queryDictTypeList(data) {
  return fetch("/nb-pc/1.0.1/DictService/queryDictTypeList", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 新增字典数据
export function addDictData(data) {
  return fetch("/nb-pc/1.0.1/DictService/addDictData", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 新增字典类型
export function addDictType(data) {
  return fetch("/nb-pc/1.0.1/DictService/addDictType", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改字典数据
export function updateDictData(data) {
  return fetch("/nb-pc/1.0.1/DictService/updateDictData", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改字典类型
export function updateDictType(data) {
  return fetch("/nb-pc/1.0.1/DictService/updateDictType", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 删除字典数据
export function deleteDictData(data) {
  return fetch("/nb-pc/1.0.1/DictService/deleteDictData", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 删除字典类型
export function deleteDictType(data) {
  return fetch("/nb-pc/1.0.1/DictService/deleteDictType", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
